package net.kts.location;

import java.util.ArrayList;
import java.util.List;

import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;

class MyLocationListener implements LocationListener{
	private List<LocationListener> locationListeners;

	MyLocationListener() {
		super();
		this.locationListeners = new ArrayList<LocationListener>();
	}
	
	void addLocationListener(LocationListener listener){
		locationListeners.add(listener);
	}
	

	@Override
	public void onLocationChanged(Location location) {
		for (LocationListener listener : locationListeners) {
			listener.onLocationChanged(location);
		}
	}

	@Override
	public void onProviderDisabled(String provider) {
		for (LocationListener listener : locationListeners) {
			listener.onProviderDisabled(provider);
		}
		
	}

	@Override
	public void onProviderEnabled(String provider) {
		for (LocationListener listener : locationListeners) {
			listener.onProviderEnabled(provider);
		}
	}

	@Override
	public void onStatusChanged(String provider, int status, Bundle extras) {
		for (LocationListener listener : locationListeners) {
			listener.onStatusChanged(provider, status, extras);
		}
	}
}
